// platform sdk
#include <windows.h>

// editor
#include "SplitBarScreen.h"
#include "editorutil.h"
#include "ScreenGDIInfo.h"

namespace editor {

SplitBarScreen::SplitBarScreen(int id, HWND hWnd, int x, int y, int width, int height, int minX, int minY, int offX, int offY) :
    AbstractScreen(id, x, y, width, height, minX, minY, offX, offY),
    dc_(GetDC(hWnd)),
    cinfo_(g_cinfo)
{
}

SplitBarScreen::~SplitBarScreen() {
}

void SplitBarScreen::draw() {
    ScopedBrush brush(cinfo_.colorRef(SB_COLOR_SPLIT_BAR));
    dc_.select(brush);
    PatBlt(dc_.get(), x_, y_, width_, height_, PATCOPY);
    ScopedBrush brushcenter(cinfo_.colorRef(SB_COLOR_SPLIT_BAR_CENTER));
    dc_.select(brushcenter);
    PatBlt(dc_.get(), x_+width_/2, y_, 1, height_, PATCOPY);
}

} // end of namespace editor
